import { ref } from 'vue'
import { Table } from '../moduleDetailType'

export default function useTableMethods () {
  const tableFormRules = {
    name: [{ required: true, message: '请输入表名', trigger: 'blur' }],
    // aliasName: [{ required: true, message: '请输入别名', trigger: 'blur' }],
    comment: [],
    charset: [{ required: true, message: '请输入字符集', trigger: 'blur' }],
    rowFormat: [{ required: true, message: '请输入行格式', trigger: 'blur' }],
    collate: [{ required: true, message: '请输入校对规则', trigger: 'blur' }],
    engine: [{ required: true, message: '请输入存储引擎', trigger: 'blur' }]
  } as any
  const formDataTable = ref<Table>({
    name: '',
    aliasName: '',
    comment: '',
    charset: 'utf8mb4',
    rowFormat: 'DYNAMIC',
    collate: 'utf8mb4_0900_ai_ci',
    engine: 'InnoDB'
  })
  return { tableFormRules, formDataTable }
}
